package lv.bond.science.nnstudio;

import lv.bond.science.nnstudio.ui.errorgraph.ErrorGraphView;
import lv.bond.science.nnstudio.ui.imageloader.ImageLoadView;
import lv.bond.science.nnstudio.ui.netsetup.NetSetupView;
import lv.bond.science.nnstudio.ui.testgraph.TestGraphView;
import lv.bond.science.nnstudio.ui.testresult.TestResultView;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

public class Perspective implements IPerspectiveFactory {

	public void createInitialLayout(IPageLayout layout) {
		
		layout.addStandaloneView(
				NetSetupView.ID, 
				true, 
				IPageLayout.LEFT, 
				0.22f, 
				IPageLayout.ID_EDITOR_AREA);
		
		IFolderLayout right = layout.createFolder(
				"right", 
				IPageLayout.RIGHT, 
				0.78f, 
				IPageLayout.ID_EDITOR_AREA);
		
		right.addView(ErrorGraphView.ID);
		right.addView(TestGraphView.ID);
		right.addView(TestResultView.ID);
		/*
		IFolderLayout folder = layout.createFolder("messages", IPageLayout.TOP, 0.5f, editorArea);
		folder.addPlaceholder(View.ID + ":*");
		folder.addView(View.ID);
		*/
		
		layout.addView(
				ImageLoadView.ID,
				IPageLayout.BOTTOM,
	    		0.78f,
	    		"right");
	    
		layout.getViewLayout(NetSetupView.ID).setCloseable(false);
		layout.getViewLayout(ErrorGraphView.ID).setCloseable(false);
		layout.getViewLayout(TestGraphView.ID).setCloseable(false);
		layout.getViewLayout(ImageLoadView.ID).setCloseable(false);
		
	    layout.addShowViewShortcut(NetSetupView.ID);
	    layout.addShowViewShortcut(ErrorGraphView.ID);
	    layout.addShowViewShortcut(TestGraphView.ID);
	    layout.addShowViewShortcut(ImageLoadView.ID);
	    
	    layout.setEditorAreaVisible(false); 
	}

}
